package com.fileio.filedirectory;

import java.io.File;

public class ConstructFilePath {
	public static void main(String[] args) {

		/*
		 * To create a file path use File.separator constant defined in File
		 * class.
		 * 
		 * Windows based machines has path like \dir1\dir2 while UNIX based
		 * machines has path like /dir1/dir2
		 */

		String filePath = File.separator + "JavaExamples" + File.separator
				+ "IO";

		// create new File object
		File file = new File(filePath);

		/*
		 * Please note that creating file object DOES NOT actually create a
		 * file. It DOES NOT have any effects on the filesystem.
		 */

		// display file path using getPath() method of File class.
		System.out.println("File path is : " + file.getPath());

	}
}
